package com.kyzh.core.adapters

import android.util.Log
import android.widget.TextView
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder
import com.gushenge.core.beans.ShareHistory
import com.gushenge.core.requests.WealRequest
import com.kyzh.core.R
import com.kyzh.core.dialog.showEditDialog
import com.kyzh.core.utils.setVisibility

class ShareHistoryAdapter(layout:Int, beans:ArrayList<ShareHistory>, val type:Int): BaseQuickAdapter<ShareHistory, BaseViewHolder>(layout,beans){


    override fun convert(p0: BaseViewHolder, p1: ShareHistory) {
        p0.setText(R.id.tv1, if (type==0)context.getString(R.string.registerTime ) else p1.user_name)
                .setText(R.id.tv2, if (type==0)context.getString(R.string.friendUserName) else p1.points)
                .setText(R.id.tv3, p1.time)
                .setText(R.id.tv4, if (type==0) p1.user_name else p1.note)
        val view = p0.getView<TextView>(R.id.tvpost)


        if(p1.is_fafang){
            view.text = "已发放"
        }else{
            view.text = "发放"
        }
    }
}